<?php
include_once("../service/ProductService.php");
/**
 * @author Minh Luan
 * @copyright 2012
 */
if(isset($_GET['n'])){
        $img_id = $_GET['n'];
        $pro_id = $_GET['p'];
        $img = mysql_fetch_array(getImageInformation($img_id));
        if(unlink("../images/product/PRO_".$pro_id."/".$img["IMG_PATH"])){
            updateImageUrl($img_id,"");    
        }
        echo "<script>location.href='../admin/product-detail.php?do=view&n=".$pro_id."&msg=3'</script>";
}else{
    echo "<script>location.href='../admin/product-detail.php?do=view&n=".$pro_id."&msg=4'</script>";
}
?>